module.exports = (app) => {
  const router = require("express").Router();
  // 用户 模型 api 接口
  const UserApi = require("../controller/controller_user");

  router.get("/user/get", UserApi.create.app.get);
  router.post("/user/post", UserApi.create.app.post);
  router.get("/user/login", UserApi.create.login);

  // 轮播图 模型 api 接口
  const carouselApi = require("../controller/controller_carousel");
  router.get("/carousel/get", carouselApi.create.get);
  router.post("/carousel/post", carouselApi.create.post);

  // 文章 模型 api 接口
  const articleApi = require("../controller/controller_article");
  router.get("/article/get", articleApi.create.get);
  router.post("/article/post", articleApi.create.post);

  // 评论 模型 api 接口
  const commentApi = require("../controller/controller_comment");
  router.get("/comment/get", commentApi.create.get);
  router.post("/comment/post", commentApi.create.post);

  // 分类 模型 api 接口
  const blog_categoryApi = require("../controller/controller_blog_category");
  router.get("/blog_categoryApi/get", blog_categoryApi.create.get);
  router.post("/blog_categoryApi/post", blog_categoryApi.create.post);

  // 用户关注表 api 接口
  const user_followsApi = require("../controller/controller_user_follows.js");
  router.get("/user_followsApi/get", user_followsApi.create.get);
  router.post("/user_followsApi/post", user_followsApi.create.post);

  // 用户数据删除操作
  require("../controller/delete/index.js").create(router)

  // 文件下载 / 上传 接口
  // 地址 : /image/upload
  require("../upload/controller/controller_upload").create(router);
  // 地址 : /image/download
  require("../upload/controller/controller_download").create(router);

  // 文件的删除接口
  // 地址 : /image/delete
  require("../upload/controller/controller_delete").create(router);
  // 地址 : /image/update
  require("../upload/controller/controller_update").create(router);



  // QQ邮箱 STMP 接口
  require("../STMP/index").create(router);

  // 微信登录获取用户 ID
  require("../weixinID/index").create(router);

  app.use("/api/app_api", router);
};
